def formatTime(time):
    if time < 0:
        time = 0
        
    time = int(time)
    s = time % 60
    m = time / 60 % 60
    h = time / 3600 % 60
    if h == 0:
        return "%i:%0.2i" % (m, s)
    else:
        return "%i:%0.2i:%0.2i" % (h, m, s)


